package lumis.portal.propertybag;

import lumis.portal.PortalException;
import lumis.portal.stability.StableMinor;

/**
 * Manages property bag instances. All methods require a transactional context.
 *
 * @depend - manages - PropertyBag
 *
 * @version $Revision: 13082 $ $Date: 2011-05-27 16:03:12 -0300 (Fri, 27 May 2011) $
 * @since 5.0.0
 */
@StableMinor(version = "6.0", sinceVersion = "5.0")
public interface IPropertyBagManager
{
	/**
	 * Persists a property bag.
	 * 
	 * @param bag the property bag to persist.
	 * @since 5.0.0
	 */
	public void add(PropertyBag bag) throws PortalException;
	
	/**
	 * Returns the property bag with the given identifier.
	 * 
	 * @param propertyBagId identifier of the property bag.
	 * @return the property bag.
	 * @since 5.0.0
	 */
	public PropertyBag get(String propertyBagId) throws PortalException;
	
	/**
	 * Deletes the given property bag.
	 * <p>
	 * Delete is not done recursively. There must not be any child property bags
	 * that have the given property bag as its parent.
	 * </p>
	 * @param bag the property bag to be deleted.
	 * @since 5.0.0
	 */
	public void delete(PropertyBag bag) throws PortalException;
}
